<!-- 顶部条 -->
<div class="header">
    <div class="container">
        <span class="title" onclick="javascript:location.href='/blog/index.php'">根的博客 </span>
        <div class="search">
            <div class="input-group">
                <input type="text" class="form-control" placeholder="输入博客标题搜索">
                <span class="input-group-btn">
                    <button class="btn btn-default">搜索</button>
                </span>
            </div>
        </div>

        <div class="login-reg">
            <?php if($user){?>
                <span><?php echo $user['username'];?></span> <a href="javascript:logout();">退出</a>
            <?php }else{?>
                <button class="btn btn-success" onclick="loginOpen()">登录</button>
            <?php }?>
            <button class="btn btn-warning" onclick="add_article()">发表博客</button>
        </div>
    </div>
</div>